<template>
	<div>
		<!-- GetEndExamPageList，GetEndAlreadyExamPageList -->
		<div class="h2">积分发放申请审批</div>
		<a-tabs default-active-key="5" @change="tabChange">
			<a-tab-pane key="5" tab="待审批"><ActivityFlow5 ref="ActivityFlow5" :parentType="2" @applyHander="applyHander"></ActivityFlow5></a-tab-pane>
			<a-tab-pane key="6" tab="已审批"><ActivityFlow6 ref="ActivityFlow6" :parentType="2"></ActivityFlow6></a-tab-pane>
		</a-tabs>
		<activityApplyExam :isShow="true" :text="text" :textArr="textArr" v-show="applyIf" @closeFun="closeFun"></activityApplyExam>
	</div>
</template>

<script>
import ActivityFlow5 from '../../../components/views/CreditSendRecordExam/ActivityFlow5.vue';
import ActivityFlow6 from '../../../components/views/CreditSendRecordExam/ActivityFlow6.vue';
import moment from 'moment';
import activityApplyExam from '@/components/views/CreditSendRecordExam/activityApplyExam';
import Func from '@/utils/func';
import {
	GetCollegeExamPageList,
	GetCollegeAlreadyExamPageList,
	GetSchoolExamPageList,
	GetSchoolAlreadyExamPageList,
	GetEndExamPageList,
	GetEndAlreadyExamPageList,
	DeleteActivity,
	GetActivityStateList,
	GetClubPageListCommon
} from '@/api/follow';
export default {
	components: {
		activityApplyExam,
		ActivityFlow5,
		ActivityFlow6
	},
	data() {
		return {
			applyIf: false,
			form: this.$form.createForm(this, {
				name: 'advanced_search'
			}),
			addIf: false,
			text: {},
			textArr:[],
			visible: false,
			confirmLoading: false,
			itemId: '',
			departmentList: [],
			worklist: [],
			tableHeight: parseFloat(window.innerHeight - 160),
			ActivityStateList: [],
			ClubList: [],
			tabkey: 5
		};
	},
	computed: {},
	created() {
	},
	mounted() {},
	methods: {
		moment,
		tabChange(key) {
			this.tabkey = key;
		},
		filterOption(input, option) {
			return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0;
		},
		async fetchClub(value) {
			let myReg = /^[^a-zA-Z]+$/;
			if (value && value.length>1) {
				let data = {};
				data.key = value;
				let res = await GetClubPageListCommon(data);
				this.ClubList = res.data.data;
			}
		},
		addList() {
			this.text = {};
			this.addIf = !this.addIf;
		},
		seeList(text, name) {
			let path = 'ActivityFlowDetail';
			this.$router.push({
				name: path,
				query: {
					ID: text.ID
				}
			});
		},
		applyHander(item) {
			if(Object.prototype.toString.call(item)=='[object Array]'){
				this.textArr = item;
			}else{
				this.text = item;
			}
			// this.text = { ...item,time:new Date() };
			this.applyIf = true;
		},
		closeFun(data) {
			this.applyIf = false;
			if(data==1){
				this.$refs.ActivityFlow5.getList();
				this.$refs.ActivityFlow6.getList();
			}
		}
	}
};
</script>

<style lang="less" scoped>
/deep/.ant-form-item {
	display: flex;
	margin-bottom: 10px !important;

	/deep/.ant-form-item-label {
		width: 80px;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
		text-align: right;
	}
	/deep/.ant-form-item-control-wrapper {
		flex: 1;
	}
}
/deep/.el-table th.is-leaf {
	background: #fafafa;
}
/deep/.el-table td,
/deep/.el-table th {
	padding: 5px;
}
.option {
	margin-top: 10px;
	margin-bottom: 20px;
	overflow: hidden;
}
.option .btn {
	height: 36px;
	line-height: 36px;
	padding: 0 10px;
	float: left;
	background: #1890ff;
	color: #fff;
	margin-right: 10px;
	border-radius: 3px;
	cursor: pointer;
	border: none;
}
.foot {
	text-align: center;
	margin-top: 100px;
}
.el-pagination {
	margin-top: 10px;
}
/deep/ .ant-form-item-control-wrapper {
	min-width: 200px;
}
</style>
